import request from '@neu/biz-core/utils/request'

export const options = () => {
  return request({
    url: '/cmdb/categories/options',
    method: 'get'
  })
}

export const page = (params) => {
  return request({
    url: '/cmdb/categories/page',
    params,
    method: 'get'
  })
}

export const detail = (id) => {
  return request({
    url: '/cmdb/categories/' + id,
    method: 'get'
  })
}

export const update = (id, data) => {
  return request({
    url: '/cmdb/categories/' + id,
    data: data,
    method: 'put'
  })
}

export const create = (data) => {
  return request({
    url: '/cmdb/categories',
    data: data,
    method: 'post'
  })
}

export const remove = (id) => {
  return request({
    url: '/cmdb/categories/' + id,
    method: 'delete'
  })
}

export const countOfCategory1 = () => {
  return request({
    url: '/cmdb/categories/count/1',
    method: 'get'
  })
}

export const countOfCategory2 = () => {
  return request({
    url: '/cmdb/categories/count/2',
    method: 'get'
  })
}

